﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:System;assembly=mscorlib"
                    xmlns:sldg="http://schemas.xceed.com/silverlight/xaml/datagrid"
                    xmlns:conv="http://schemas.xceed.com/silverlight/xaml/datagrid"
                    xmlns:ctrl="http://schemas.xceed.com/silverlight/xaml/controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="SilverlightThemeExplicitStyles.Framework.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- =================================================================== -->
    <!-- Resources specific to this Theme/ColorScheme                        -->
    <!-- =================================================================== -->

    <LinearGradientBrush x:Key="SilverlightThemeInvalidItemGlyphBackgroundBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
        <GradientStop Color="#FFD00000"
                    Offset="0" />
        <GradientStop Color="Red"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeInvalidItemGlyphBorderBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
        <GradientStop Color="#FFA10000" />
        <GradientStop Color="#FFDC0000"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupBackgroundBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
        <GradientStop Color="#EBEDEF"
                    Offset="1" />

        <GradientStop Color="#FBFBFB"
                    Offset="0" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupByItemBackgroundBrush"
                        StartPoint="0.5,0"
                        EndPoint="0.5,1">
        <GradientStop Color="#FFedeff0"
                    Offset="0" />
        <GradientStop Color="#FFdadee0"
                    Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="SilverlightThemeBorderBrush"
                    Color="#C9CACA" />

    <!--Background for InsertionRow and FilterRow-->
    <LinearGradientBrush x:Key="SilverlightThemeSpecialRowBackgroundBrush"
                        StartPoint="0.5,0"
                        EndPoint="0.5,1">
        <GradientStop Color="#FFe1e8f0"
                    Offset="0" />
        <GradientStop Color="#FFffffff"
                    Offset="0.95" />
        <GradientStop Color="#FFc9caca"
                    Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="SilverlightThemeHighlightBorderBrush"
                    Color="#6DBDD1" />

    <LinearGradientBrush x:Key="SilverlightThemeCurrentGroupBrush"
                        StartPoint="0.5,0"
                        EndPoint="0.5,1">
        <GradientStop Color="#FFe1ecf6"
                    Offset="0" />
        <GradientStop Color="#FFbcd6eb"
                    Offset="0.5" />
        <GradientStop Color="#FF75abd8"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupByControlBrush"
                        StartPoint="0.5,1"
                        EndPoint="0.5,0">
        <GradientStop Color="#FFFBFBFB"
                    Offset="0" />
        <GradientStop Color="#FFD6DBDF"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupNavigationButtonDefaultBackgroundBrush"
                        StartPoint="0.5,0"
                        EndPoint="0.5,1">
        <GradientStop Color="#FFFBFBFB"
                    Offset="0" />

        <GradientStop Color="#FFD6DBDF"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupNavigationButtonDefaultBorderBrush"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
        <GradientStop Color="#FFCFD0D0"
                    Offset="0" />

        <GradientStop Color="#FFC9CACA"
                    Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SilverlightThemeGroupNavigationButtonPressedBackgroundBrush"
                        StartPoint="0.5,0"
                        EndPoint="0.5,1.04">
        <GradientStop Color="#FFe1ecf6"
                    Offset="0" />

        <GradientStop Color="#FFd5e5f2"
                    Offset="0.3" />

        <GradientStop Color="#FFaecee8"
                    Offset="0.5" />

        <GradientStop Color="#FF75abd8"
                    Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="SilverlightThemeLoadingSpinnerShadowBackgroundBrush"
                    Color="#FF616161" />

    <SolidColorBrush x:Key="SilverlightThemeLoadingSpinnerHighlightBackgroundBrush"
                    Color="#BADDE9" />

    <SolidColorBrush x:Key="SilverlightThemeCommittingSpinnerHighlightBackgroundBrush"
                    Color="#FF6F9DD9" />

    <SolidColorBrush x:Key="SilverlightThemeCommittingSpinnerShadowBackgroundBrush"
                    Color="#7FFFFFFF" />

    <SolidColorBrush x:Key="SilverlightThemeFixedCellBackgroundBrush"
                    Color="#FFC1DDE7" />

    <conv:EmptyStringToNullConverter x:Key="SilverlightThemeEmptyStringToNullConverter" />

    <conv:ValidationErrorConverter x:Key="SilverlightThemeValidationErrorConverter" />

    <conv:RatioToOpacityConverter x:Key="SilverlightThemeRatioToOpacityConverter" />

    <!-- DataTemplate used to format the error message to show in the tooltip of a cell or row when there are validation errors. -->
    <DataTemplate x:Key="SilverlightThemeValidationErrorTemplate">
        <!-- The ToolTip's content is bound to a collection. We only want to show the first error. -->
        <TextBlock Text="{Binding Converter={StaticResource SilverlightThemeValidationErrorConverter}}" />
    </DataTemplate>

    <DataTemplate x:Key="SilverlightThemeRemoveButtonGlyph">
        <Path Height="9.33"
            Width="9.33"
            Stretch="Fill"
            Data="M 7.333343505859375,-0.6666641235351562 C7.333343505859375,-0.6666641235351562 4,2.6650009155273438 4,2.6650009155273438 4,2.6650009155273438 0.666656494140625,-0.6666641235351562 0.666656494140625,-0.6666641235351562 0.666656494140625,-0.6666641235351562 -0.666656494140625,0.6666641235351562 -0.666656494140625,0.6666641235351562 -0.666656494140625,0.6666641235351562 2.665008544921875,4 2.665008544921875,4 2.665008544921875,4 -0.666656494140625,7.333335876464844 -0.666656494140625,7.333335876464844 -0.666656494140625,7.333335876464844 0.666656494140625,8.666664123535156 0.666656494140625,8.666664123535156 0.666656494140625,8.666664123535156 4,5.334999084472656 4,5.334999084472656 4,5.334999084472656 7.333343505859375,8.666664123535156 7.333343505859375,8.666664123535156 7.333343505859375,8.666664123535156 8.666656494140625,7.333335876464844 8.666656494140625,7.333335876464844 8.666656494140625,7.333335876464844 5.334991455078125,4 5.334991455078125,4 5.334991455078125,4 8.666656494140625,0.6666641235351562 8.666656494140625,0.6666641235351562 8.666656494140625,0.6666641235351562 7.333343505859375,-0.6666641235351562 7.333343505859375,-0.6666641235351562 z"
            Fill="#A6A6A6" />
    </DataTemplate>

    <!-- Glyph that is displayed in the fake RowSelector for a Row that is current. -->
    <DataTemplate x:Key="SilverlightThemeCurrentItemGlyph">
        <Path Margin="0,2,0,0"
            Opacity="1"
            Data="M 5,4.46875 C5,4.46875 0,0 0,0 0,0 0,9 0,9 0,9 5,4.46875 5,4.46875 z"
            Fill="#FF6F9DD9" />
    </DataTemplate>

    <DataTemplate x:Key="SilverlightThemeInsertionRowGlyph">
        <Path Height="12"
            Width="12"
            Data="M 5.908846616744995,0 C5.908846616744995,0 6.165833234786987,5.293935656547546 6.165833234786987,5.293935656547546 6.165833234786987,5.293935656547546 9.765572309494019,1.4037333726882935 9.765572309494019,1.4037333726882935 9.765572309494019,1.4037333726882935 6.55955958366394,5.624311327934265 6.55955958366394,5.624311327934265 6.55955958366394,5.624311327934265 11.817692518234253,4.958110690116882 11.817692518234253,4.958110690116882 11.817692518234253,4.958110690116882 6.648809194564819,6.130475878715515 6.648809194564819,6.130475878715515 6.648809194564819,6.130475878715515 11.104999303817749,8.99999988079071 11.104999303817749,8.99999988079071 11.104999303817749,8.99999988079071 6.3918235301971436,6.57558810710907 6.3918235301971436,6.57558810710907 6.3918235301971436,6.57558810710907 7.960967779159546,11.638155817985535 7.960967779159546,11.638155817985535 7.960967779159546,11.638155817985535 5.908846616744995,6.7513779401779175 5.908846616744995,6.7513779401779175 5.908846616744995,6.7513779401779175 3.8567254543304443,11.638155817985535 3.8567254543304443,11.638155817985535 3.8567254543304443,11.638155817985535 5.425870180130005,6.57558810710907 5.425870180130005,6.57558810710907 5.425870180130005,6.57558810710907 0.7126941680908203,8.99999988079071 0.7126941680908203,8.99999988079071 0.7126941680908203,8.99999988079071 5.168884038925171,6.130475878715515 5.168884038925171,6.130475878715515 5.168884038925171,6.130475878715515 0,4.958110690116882 0,4.958110690116882 0,4.958110690116882 5.258134603500366,5.624311327934265 5.258134603500366,5.624311327934265 5.258134603500366,5.624311327934265 2.0521209239959717,1.4037333726882935 2.0521209239959717,1.4037333726882935 2.0521209239959717,1.4037333726882935 5.651859998703003,5.293935656547546 5.651859998703003,5.293935656547546 5.651859998703003,5.293935656547546 5.908846616744995,0 5.908846616744995,0 z"
            Fill="Black" />
    </DataTemplate>

    <DataTemplate x:Key="SilverlightThemeInvalidItemGlyph">
        <Border Background="{StaticResource SilverlightThemeInvalidItemGlyphBackgroundBrush}">
            <Border x:Name="patternLine"
                 Opacity="0.35"
                 Margin="1">
                <Border.Background>
                    <LinearGradientBrush StartPoint="-0.015,0.1"
                                    EndPoint="8.618,6.282"
                                    SpreadMethod="Repeat"
                                    MappingMode="Absolute">
                        <GradientStop Offset="0"
                                Color="Transparent" />
                        <GradientStop Color="Transparent"
                                Offset="0.5" />
                        <GradientStop Offset="0.5"
                                Color="White" />
                        <GradientStop Offset="1"
                                Color="White" />
                    </LinearGradientBrush>
                </Border.Background>
            </Border>
        </Border>
    </DataTemplate>

    <DataTemplate x:Key="SilverlightThemeFilterCellNullContentTemplate">
        <Canvas Width="13"
              Height="11">
            <Canvas.Effect>
                <DropShadowEffect BlurRadius="2"
                              ShadowDepth="1"
                              Opacity="0.3"
                              Color="White" />
            </Canvas.Effect>
            <Path Data="M6.8892,10.417L6.8892,7.001C6.8892,5.693,11.0172,3.535,11.0172,1.884L11.0172,0.233000000000001L0.146199999999999,0.233000000000001L0.146199999999999,1.884C0.146199999999999,3.505,4.2722,5.839,4.2722,7.001L4.2722,10.417z"
               Height="10.184"
               Canvas.Left="0"
               Stretch="Fill"
               Canvas.Top="0"
               Width="10.871">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.5,1"
                                    StartPoint="0.5,0">
                        <GradientStop Color="#FF7C7C7C"
                                Offset="1" />
                        <GradientStop Color="#FFB6B6B6"
                                Offset="0.208" />
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Path Data="M12.8545,9.4932C12.8545,10.0052,12.5485,10.4172,12.1725,10.4172L8.8325,10.4172C8.4555,10.4172,8.1505,10.0052,8.1505,9.4932C8.1505,8.9842,8.4555,8.5682,8.8325,8.5682L12.1725,8.5682C12.5485,8.5682,12.8545,8.9842,12.8545,9.4932"
               Height="1.849"
               Canvas.Left="8.254"
               Stretch="Fill"
               Canvas.Top="8.335"
               Width="4.704"
               Fill="#FF969696" />
            <Path Data="M12.8545,6.582C12.8545,7.092,12.5485,7.505,12.1725,7.505L8.8325,7.505C8.4555,7.505,8.1505,7.092,8.1505,6.582C8.1505,6.072,8.4555,5.658,8.8325,5.658L12.1725,5.658C12.5485,5.658,12.8545,6.072,12.8545,6.582"
               Height="1.847"
               Canvas.Left="8.254"
               Stretch="Fill"
               Canvas.Top="5.425"
               Width="4.704"
               Fill="#FF969696" />
            <Path Data="M6.1393318,9.5421095 L6.1393318,6.0633564 C6.1393318,4.7553558 9.6462555,2.891489 9.6462555,1.8286092 L9.6462555,0.92750794 L1.4586999,0.92750454 L1.4586999,1.9535918 C1.4586999,2.8289783 5.0220685,4.9013567 5.0220685,6.0633564 L5.0220685,9.5421095 z"
               Height="8.617"
               Canvas.Left="1.312"
               Stretch="Fill"
               Canvas.Top="0.786"
               Width="8.189"
               UseLayoutRounding="False"
               Fill="#BFFFFFFF" />
        </Canvas>

    </DataTemplate>

    <DataTemplate x:Key="SilverlightThemeFilterCellOtherContentTemplate">
        <Canvas Width="13"
              Height="11">
            <Canvas.Effect>
                <DropShadowEffect BlurRadius="2"
                              ShadowDepth="1"
                              Opacity="0.3"
                              Color="White" />
            </Canvas.Effect>
            <Path Data="M6.8892,10.417L6.8892,7.001C6.8892,5.693,11.0172,3.535,11.0172,1.884L11.0172,0.233000000000001L0.146199999999999,0.233000000000001L0.146199999999999,1.884C0.146199999999999,3.505,4.2722,5.839,4.2722,7.001L4.2722,10.417z"
               Height="10.184"
               Canvas.Left="0"
               Stretch="Fill"
               Canvas.Top="0"
               Width="10.871">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.5,1"
                                    StartPoint="0.5,0">
                        <GradientStop Color="#FF7C7C7C"
                                Offset="1" />
                        <GradientStop Color="#FFB6B6B6"
                                Offset="0.208" />
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Path Data="M12.8545,9.4932C12.8545,10.0052,12.5485,10.4172,12.1725,10.4172L8.8325,10.4172C8.4555,10.4172,8.1505,10.0052,8.1505,9.4932C8.1505,8.9842,8.4555,8.5682,8.8325,8.5682L12.1725,8.5682C12.5485,8.5682,12.8545,8.9842,12.8545,9.4932"
               Height="1.849"
               Canvas.Left="8.254"
               Stretch="Fill"
               Canvas.Top="8.335"
               Width="4.704"
               Fill="#FF969696" />
            <Path Data="M12.8545,6.582C12.8545,7.092,12.5485,7.505,12.1725,7.505L8.8325,7.505C8.4555,7.505,8.1505,7.092,8.1505,6.582C8.1505,6.072,8.4555,5.658,8.8325,5.658L12.1725,5.658C12.5485,5.658,12.8545,6.072,12.8545,6.582"
               Height="1.847"
               Canvas.Left="8.254"
               Stretch="Fill"
               Canvas.Top="5.425"
               Width="4.704"
               Fill="#FF969696" />
        </Canvas>
    </DataTemplate>

    <conv:NullToContentConverter x:Key="SilverlightThemeFilterCellNullToContentConverter"
                                NullContentTemplate="{StaticResource SilverlightThemeFilterCellNullContentTemplate}"
                                OtherContentTemplate="{StaticResource SilverlightThemeFilterCellOtherContentTemplate}" />

    <Style TargetType="Button"
          x:Key="SilverlightThemeRemoveButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <Path  Margin="0"
                         Opacity="1"
                         Fill="#4D5874"
                         Stretch="Fill"
                         HorizontalAlignment="Center"
                         UseLayoutRounding="False"
                         Data="M345.75,283.75 L336.25,293.25 L355.875,312.875 L336.875,331.875 L346.25,341.25 L365,322.5 L383.375,340.875 L392,332.25 L373.625,313.875 L394,293.5 L384.25,283.75 L365.5,302.5 z" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SilverlightThemeLicensingStateRichTextBoxStyle"
          TargetType="RichTextBox">

        <Setter Property="HorizontalAlignment"
              Value="Left" />
        <Setter Property="FontSize"
              Value="13.333" />
        <Setter Property="Foreground"
              Value="White" />
        <Setter Property="VerticalAlignment"
              Value="Top" />
        <Setter Property="IsReadOnly"
              Value="True" />
        <Setter Property="IsTabStop"
              Value="False" />
        <Setter Property="CaretBrush"
              Value="Transparent" />
        <Setter Property="Background"
              Value="Transparent" />
        <Setter Property="BorderThickness"
              Value="0" />
    </Style>

    <Style x:Key="SilverlightThemeUpNavigationButtonStyle"
          TargetType="Button">
        <Setter Property="Foreground"
              Value="#6B6A6B" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="grid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.200" />

                                    <VisualTransition From="MouseOver"
                                             To="Pressed" />
                                </VisualStateGroup.Transitions>

                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Over" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Pressed1" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="0.5"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="grid" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" >
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Over" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Background"
                          BorderThickness="1"
                          BorderBrush="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBorderBrush}"
                          Background="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBackgroundBrush}" />

                        <Border x:Name="Over"
                          Opacity="0"
                          BorderThickness="1">
                            <Border.Background>
                                <LinearGradientBrush StartPoint="0.5,0"
                                             EndPoint="0.5,1">
                                    <GradientStop Color="#FFfbfcfd"
                                         Offset="0" />

                                    <GradientStop Color="#FFeef4f9"
                                         Offset="0.36" />

                                    <GradientStop Color="#FFa4c7e5"
                                         Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border x:Name="Pressed1"
                          Opacity="0"
                          BorderThickness="1"
                          Background="{StaticResource SilverlightThemeGroupNavigationButtonPressedBackgroundBrush}" />

                        <ContentPresenter x:Name="contentPresenter"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Content="{TemplateBinding Content}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Margin="3,0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SilverlightThemeDownNavigationButtonStyle"
          TargetType="Button">
        <Setter Property="Foreground"
              Value="#6B6A6B" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="grid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.200" />

                                    <VisualTransition From="MouseOver"
                                             To="Pressed" />
                                </VisualStateGroup.Transitions>

                                <VisualState x:Name="Normal" />

                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Over" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Pressed1" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="0.5"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="grid" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" >
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.000"
                                               To="1"
                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Over" />
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Background"
                          BorderThickness="0,1,1,1"
                          BorderBrush="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBorderBrush}"
                          Background="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBackgroundBrush}" />

                        <Border x:Name="Over"
                          Opacity="0"
                          BorderThickness="0,1,1,1">
                            <Border.Background>
                                <LinearGradientBrush StartPoint="0.5,0"
                                             EndPoint="0.5,1">
                                    <GradientStop Color="#FFfbfcfd"
                                         Offset="0" />

                                    <GradientStop Color="#FFeef4f9"
                                         Offset="0.36" />

                                    <GradientStop Color="#FFa4c7e5"
                                         Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border x:Name="Pressed1"
                          Opacity="0"
                          BorderThickness="0,1,1,1"
                          Background="{StaticResource SilverlightThemeGroupNavigationButtonPressedBackgroundBrush}" />

                        <ContentPresenter x:Name="contentPresenter"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    Content="{TemplateBinding Content}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Margin="3,0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="SilverlightThemeTextBoxEditorTemplate"
                    TargetType="TextBox">

        <Border x:Name="MouseOverBorder"
              BorderThickness="1"
              BorderBrush="Transparent">

            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="MouseOverBorder"
                                     Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                     To="#FF99C1E2"
                                     Duration="0" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <ScrollViewer x:Name="ContentElement"
                       Padding="{TemplateBinding Padding}"
                       BorderThickness="0"
                       IsTabStop="False" />
        </Border>

    </ControlTemplate>

    <ControlTemplate x:Key="SilverlightThemeScrollToTopButtonTemplate"
                    TargetType="Button">
        <Grid x:Name="Root"
            Height="16">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="Background" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundGradient" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundMouseOver" />
                            <ColorAnimation Duration="0"
                                     To="#7FFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#CCFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#F2FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="Background" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundGradient" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundPressed" />
                            <DoubleAnimation Duration="0"
                                      To="1"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      Storyboard.TargetName="Highlight" />
                            <ColorAnimation Duration="0"
                                     To="#6BFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#C6FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#EAFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#F4FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To=".7"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="DisabledElement" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle RadiusY="1"
                    RadiusX="1"
                    Stroke="#00000000"
                    StrokeThickness="1">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0,0.5"
                                    StartPoint="1,0.5">
                        <GradientStop Color="#FFF4F6F7"
                                Offset="0" />
                        <GradientStop Color="#FFF0F4F7"
                                Offset="0.344" />
                        <GradientStop Color="#FFDFE3E6"
                                Offset="1" />
                        <GradientStop Color="#FFE9EEF4"
                                Offset="0.527" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>

            <Rectangle Opacity=".375"
                    RadiusY="1"
                    RadiusX="1"
                    StrokeThickness="1">
                <Rectangle.Stroke>
                    <LinearGradientBrush EndPoint="0.5,1"
                                    StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9"
                                Offset="0" />
                        <GradientStop Color="#FF8399A9"
                                Offset="0.375" />
                        <GradientStop Color="#FF718597"
                                Offset="0.375" />
                        <GradientStop Color="#FF617584"
                                Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Stroke>
            </Rectangle>

            <Rectangle Margin="1"
                    RadiusY="1"
                    RadiusX="1">
                <Rectangle.Stroke>
                    <LinearGradientBrush EndPoint="0.125,0.5"
                                    StartPoint="0.875,0.5">
                        <GradientStop Color="#33FFFFFF" />
                        <GradientStop Color="#99FFFFFF"
                                Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Stroke>
            </Rectangle>

            <Grid Margin="1">
                <Rectangle x:Name="Background"
                       Fill="#FF1F3B53"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       StrokeThickness="1">
                    <Rectangle.Stroke>
                        <LinearGradientBrush EndPoint="1,.5"
                                       StartPoint="0,.5">
                            <GradientStop Color="#FF647480"
                                   Offset="1" />
                            <GradientStop Color="#FFAEB7BF"
                                   Offset="0" />
                            <GradientStop Color="#FF919EA7"
                                   Offset="0.35" />
                            <GradientStop Color="#FF7A8A99"
                                   Offset="0.35" />
                        </LinearGradientBrush>
                    </Rectangle.Stroke>
                </Rectangle>
                <Rectangle x:Name="BackgroundMouseOver"
                       Fill="#FF448DCA"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       Stroke="#00000000"
                       StrokeThickness="1" />
                <Rectangle x:Name="BackgroundPressed"
                       Fill="#FF448DCA"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       Stroke="#00000000"
                       StrokeThickness="1" />
                <Rectangle x:Name="BackgroundGradient"
                       Margin="1"
                       Opacity="0"
                       RadiusY="1"
                       RadiusX="1"
                       Stroke="#FFFFFFFF"
                       StrokeThickness="1">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="1,.7"
                                       StartPoint="0,.7">
                            <GradientStop Color="#FFFFFFFF"
                                   Offset="0.013" />
                            <GradientStop Color="#F9FFFFFF"
                                   Offset="0.375" />
                            <GradientStop Color="#E5FFFFFF"
                                   Offset="0.603" />
                            <GradientStop Color="#C6FFFFFF"
                                   Offset="1" />
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle x:Name="Highlight"
                       IsHitTestVisible="false"
                       Margin="1"
                       Opacity="0"
                       RadiusY="1"
                       RadiusX="1"
                       Stroke="{StaticResource SilverlightThemeHighlightBorderBrush}"
                       StrokeThickness="1" />
                <Path Data="M0,6 L7,6 L4,2 L7,2 L7,0 L0,0 L0,2 L4,2 z"
                  Height="6"
                  Stretch="Uniform"
                  Width="7">
                    <Path.Fill>
                        <SolidColorBrush x:Name="ButtonColor"
                                   Color="#FF333333" />
                    </Path.Fill>
                </Path>
                <Rectangle x:Name="DisabledElement"
                       Fill="#FFFFFFFF"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="SilverlightThemeScrollToBottomButtonTemplate"
                    TargetType="Button">
        <Grid x:Name="Root"
            Height="16">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="Background" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundGradient" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundMouseOver" />
                            <ColorAnimation Duration="0"
                                     To="#7FFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#CCFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#F2FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="Background" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundGradient" />
                            <DoubleAnimation Duration="0:0:0"
                                      To="1"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="BackgroundPressed" />
                            <DoubleAnimation Duration="0"
                                      To="1"
                                      Storyboard.TargetProperty="(UIElement.Opacity)"
                                      Storyboard.TargetName="Highlight" />
                            <ColorAnimation Duration="0"
                                     To="#6BFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#C6FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#EAFFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                            <ColorAnimation Duration="0"
                                     To="#F4FFFFFF"
                                     Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                     Storyboard.TargetName="BackgroundGradient" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0"
                                      To=".7"
                                      Storyboard.TargetProperty="Opacity"
                                      Storyboard.TargetName="DisabledElement" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle RadiusY="1"
                    RadiusX="1"
                    Stroke="#00000000"
                    StrokeThickness="1">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0,0.5"
                                    StartPoint="1,0.5">
                        <GradientStop Color="#FFF4F6F7"
                                Offset="0" />
                        <GradientStop Color="#FFF0F4F7"
                                Offset="0.344" />
                        <GradientStop Color="#FFDFE3E6"
                                Offset="1" />
                        <GradientStop Color="#FFE9EEF4"
                                Offset="0.527" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>

            <Rectangle Opacity=".375"
                    RadiusY="1"
                    RadiusX="1"
                    StrokeThickness="1">
                <Rectangle.Stroke>
                    <LinearGradientBrush EndPoint="0.5,1"
                                    StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9"
                                Offset="0" />
                        <GradientStop Color="#FF8399A9"
                                Offset="0.375" />
                        <GradientStop Color="#FF718597"
                                Offset="0.375" />
                        <GradientStop Color="#FF617584"
                                Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Stroke>
            </Rectangle>

            <Rectangle Margin="1"
                    RadiusY="1"
                    RadiusX="1">
                <Rectangle.Stroke>
                    <LinearGradientBrush EndPoint="0.125,0.5"
                                    StartPoint="0.875,0.5">
                        <GradientStop Color="#33FFFFFF" />
                        <GradientStop Color="#99FFFFFF"
                                Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Stroke>
            </Rectangle>

            <Grid Margin="1">
                <Rectangle x:Name="Background"
                       Fill="#FF1F3B53"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       StrokeThickness="1">
                    <Rectangle.Stroke>
                        <LinearGradientBrush EndPoint="1,.5"
                                       StartPoint="0,.5">
                            <GradientStop Color="#FF647480"
                                   Offset="1" />
                            <GradientStop Color="#FFAEB7BF"
                                   Offset="0" />
                            <GradientStop Color="#FF919EA7"
                                   Offset="0.35" />
                            <GradientStop Color="#FF7A8A99"
                                   Offset="0.35" />
                        </LinearGradientBrush>
                    </Rectangle.Stroke>
                </Rectangle>
                <Rectangle x:Name="BackgroundMouseOver"
                       Fill="#FF448DCA"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       Stroke="#00000000"
                       StrokeThickness="1" />
                <Rectangle x:Name="BackgroundPressed"
                       Fill="#FF448DCA"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2"
                       Stroke="#00000000"
                       StrokeThickness="1" />
                <Rectangle x:Name="BackgroundGradient"
                       Margin="1"
                       Opacity="0"
                       RadiusY="1"
                       RadiusX="1"
                       Stroke="#FFFFFFFF"
                       StrokeThickness="1">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="1,.7"
                                       StartPoint="0,.7">
                            <GradientStop Color="#FFFFFFFF"
                                   Offset="0.013" />
                            <GradientStop Color="#F9FFFFFF"
                                   Offset="0.375" />
                            <GradientStop Color="#E5FFFFFF"
                                   Offset="0.603" />
                            <GradientStop Color="#C6FFFFFF"
                                   Offset="1" />
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
                <Rectangle x:Name="Highlight"
                       IsHitTestVisible="false"
                       Margin="1"
                       Opacity="0"
                       RadiusY="1"
                       RadiusX="1"
                       Stroke="{StaticResource SilverlightThemeHighlightBorderBrush}"
                       StrokeThickness="1" />
                <Path Data="M 0,0 L7,0 L4,4 L7,4 L7,6 L0,6 L0,4 L3,4 z"
                  Height="6"
                  Stretch="Uniform"
                  Width="7">
                    <Path.Fill>
                        <SolidColorBrush x:Name="ButtonColor"
                                   Color="#FF333333" />
                    </Path.Fill>
                </Path>
                <Rectangle x:Name="DisabledElement"
                       Fill="#FFFFFFFF"
                       Opacity="0"
                       RadiusY="2"
                       RadiusX="2" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: NotificationControl
    ************************** -->
    <ControlTemplate x:Key="notificationControlTemplate"
                    TargetType="sldg:NotificationControl">
        <Grid x:Name="rootGrid"
            Opacity="0"
            Visibility="Collapsed">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisibilityStates">
                    <VisualState x:Name="Hidden" />

                    <VisualState x:Name="Visible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rootGrid"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="rootGrid"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.750">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase Power="2"
                                      EasingMode="EaseOut" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                            <DoubleAnimation Storyboard.TargetName="rootGridTranslateTransform"
                                      Storyboard.TargetProperty="Y"
                                      To="0"
                                      Duration="00:00:00.750">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase Power="2"
                                      EasingMode="EaseOut" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid>
                <Border CornerRadius="6,6,0,0">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1"
                                       StartPoint="0.5,0">
                            <GradientStop Color="#FFCA4800"
                                   Offset="1" />
                            <GradientStop Color="#FFFF9B09" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                <Border BorderBrush="#66000000"
                    BorderThickness="1"
                    CornerRadius="6,6,0,0" />
                <Border BorderBrush="#33FFFFFF"
                    BorderThickness="1"
                    CornerRadius="5,5,0,0"
                    Margin="1" />
                <Border Opacity="0.08"
                    CornerRadius="6,6,0,0">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="-0.015,0.1"
                                       EndPoint="9.187,9.236"
                                       SpreadMethod="Repeat"
                                       MappingMode="Absolute">
                            <GradientStop Offset="0"
                                   Color="Transparent" />
                            <GradientStop Color="Transparent"
                                   Offset="0.5" />
                            <GradientStop Offset="0.5"
                                   Color="White" />
                            <GradientStop Offset="1"
                                   Color="White" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
            </Grid>

            <TextBlock Foreground="White"
                    Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Notification, Mode=OneWay}"
                    TextTrimming="WordEllipsis"
                    ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Notification, Mode=OneWay}"
                    Margin="8,5,5,5"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left" />
            <Grid.RenderTransform>
                <TranslateTransform x:Name="rootGridTranslateTransform"
                                Y="12" />
            </Grid.RenderTransform>
        </Grid>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: DataGridControl
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeDataGridControlTemplate"
                    TargetType="sldg:DataGridControl">
        <Grid sldg:DataGridBehaviors.ClipElement="True">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="RequestStates">
                    <VisualState x:Name="NoPendingRequests">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="loadingIndicator"
                                                      Storyboard.TargetProperty="RequestsPending">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>
                                            False
                                        </s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="loadingIndicator"
                                                   Storyboard.TargetProperty="Visibility">
                                <!-- Use same duration as loading spinner fadeOut animation -->
                                <DiscreteObjectKeyFrame KeyTime="00:00:01.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="RequestsPending">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="loadingIndicator"
                                                   Storyboard.TargetProperty="RequestsPending">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>
                                            True
                                        </s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="loadingIndicator"
                                                   Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>

                </VisualStateGroup>

                <VisualStateGroup x:Name="UnconstrainedStates">
                    <VisualState x:Name="Constrained" />
                    <VisualState x:Name="Unconstrained">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnconstrainedMessage"
                                                   Storyboard.TargetProperty="Visibility"
                                                   Duration="00:00:0.0">
                                <DiscreteObjectKeyFrame KeyTime="00:00:0.0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="LicensingStates">
                    <VisualState x:Name="Licensed" />
                    <VisualState x:Name="NotLicensed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="licensingMessage"
                                                   Storyboard.TargetProperty="Visibility"
                                                   Duration="00:00:0.0">
                                <DiscreteObjectKeyFrame KeyTime="00:00:0.0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Border x:Name="dataGridPanelHost" 
                    Grid.Column="0"
                    Grid.Row="1"
                    Grid.RowSpan="3"/>

            <TextBlock FontSize="14"
                       FontWeight="Bold"
                       Opacity="0.3"
                       Grid.Row="4"
                       Grid.Column="0">
                <TextBlock.RenderTransform>
                    <RotateTransform Angle="-90" />
                </TextBlock.RenderTransform>
               <TextBlock.Text> &#xA9;  Xceed  Software  Inc.</TextBlock.Text>
            </TextBlock>

            <Grid x:Name="UnconstrainedMessage"
                    Grid.Row="0"
                  Grid.ColumnSpan="2"
                  Visibility="Collapsed"
                  Background="#80FFFFFF">
                <Border Grid.RowSpan="3">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1"
                                          StartPoint="0.5,0">
                            <GradientStop Color="#FFCA4800"
                                      Offset="1" />
                            <GradientStop Color="#FFFF9B09" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                <Border BorderBrush="#66000000"
                       BorderThickness="1" />
                <Border BorderBrush="#33FFFFFF"
                       BorderThickness="1"
                       Margin="1" />
                <Border Opacity="0.08">
                    <Border.Background>
                        <LinearGradientBrush StartPoint="-0.015,0.1"
                                          EndPoint="9.187,9.236"
                                          SpreadMethod="Repeat"
                                          MappingMode="Absolute">
                            <GradientStop Offset="0"
                                      Color="Transparent" />
                            <GradientStop Color="Transparent"
                                      Offset="0.5" />
                            <GradientStop Offset="0.5"
                                      Color="White" />
                            <GradientStop Offset="1"
                                      Color="White" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                <TextBlock Text="The grid cannot work properly if it is used in an an unconstrained environment (e.g., StackPanel without set values for the Width and Height properties).  An arbitrary value has been assigned so it can still work, but it is best if you explicitly set its size.  This message will not appear in release mode."
                          TextWrapping="Wrap"
                          Margin="10"
                          Foreground="White"
                          Width="500"
                          FontSize="12"
                          HorizontalAlignment="Left" />
            </Grid>

            <Button Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ScrollToTopCommand}"
                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ComputedVerticalScrollBarVisibility}"
                    Grid.Column="1"
                    Grid.Row="1"
                    Template="{StaticResource SilverlightThemeScrollToTopButtonTemplate}" />

            <ScrollBar x:Name="VerticalScrollBar"
                       Orientation="Vertical"
                       Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ComputedVerticalScrollBarVisibility}"
                       Grid.Column="1"
                       Grid.Row="2" />

            <Button Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ScrollToBottomCommand}"
                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ComputedVerticalScrollBarVisibility}"
                    Grid.Column="1"
                    Grid.Row="3"
                    Template="{StaticResource SilverlightThemeScrollToBottomButtonTemplate}" />

            <ScrollBar x:Name="HorizontalScrollBar"
                       Orientation="Horizontal"
                       Grid.Row="4"
                    Grid.Column="0"
                       Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ComputedHorizontalScrollBarVisibility}" />

            <!-- LoadingIndicator's Visibility is managed in LoadingIndicator.cs to respect fadeOut anim -->
            <sldg:LoadingIndicator x:Name="loadingIndicator"
                                   Grid.Column="0"
                                   Grid.Row="0"
                                   Grid.RowSpan="4"
                                   Visibility="Collapsed"/>

            <Grid x:Name="licensingMessage"
                  Grid.Row="0"
                  Grid.RowSpan="4"
                  Grid.ColumnSpan="2"
                  Visibility="Collapsed"
                  Background="#80FFFFFF">
                <Grid HorizontalAlignment="Center"
                     VerticalAlignment="Center"
                     Width="250">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.27*" />
                        <RowDefinition Height="1" />
                        <RowDefinition Height="0.69*" />
                    </Grid.RowDefinitions>
                    <Border CornerRadius="6"
                          Grid.RowSpan="3">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                                <GradientStop Color="#FFCA4800"
                                         Offset="1" />
                                <GradientStop Color="#FFFF9B09" />
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                    <Border BorderBrush="#66000000"
                          BorderThickness="1"
                          CornerRadius="6"
                          Grid.RowSpan="3" />
                    <Border BorderBrush="#33FFFFFF"
                          BorderThickness="1"
                          CornerRadius="5"
                          Margin="1"
                          Grid.RowSpan="3" />
                    <Border Opacity="0.08"
                          CornerRadius="6"
                          Grid.RowSpan="3">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="-0.015,0.1"
                                             EndPoint="9.187,9.236"
                                             SpreadMethod="Repeat"
                                             MappingMode="Absolute">
                                <GradientStop Offset="0"
                                         Color="Transparent" />
                                <GradientStop Color="Transparent"
                                         Offset="0.5" />
                                <GradientStop Offset="0.5"
                                         Color="White" />
                                <GradientStop Offset="1"
                                         Color="White" />
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                    <Border Background="#66000000"
                    Grid.Row="1"
                          Margin="10,0" />
                    <TextBlock HorizontalAlignment="Left"
                             Margin="10,6,0,0"
                             TextWrapping="Wrap"
                             Text="Invalid License / Trial Expired"
                             VerticalAlignment="Bottom"
                             Foreground="White"
                             FontSize="16" />
                    <!-- LisencingRichTextBox was created because the class RichTextBox is not set the same
                             way in Silverlight vs WPF -->
                    <sldg:LicensingRichTextBox Style="{StaticResource SilverlightThemeLicensingStateRichTextBoxStyle}"
                                             Margin="10,6,0,10"
                                             Grid.Row="2">
                        <sldg:LicensingRichTextBox.LicensingParagraph>
                            <Paragraph>
                                <Run>A valid license key must be provided in order to license Xceed DataGrid for Silverlight. Refer to the</Run>
                                <Hyperlink NavigateUri="http://doc.xceedsoft.com/products/XceedSilverlightDataGrid/Licensing.html"
                                      TargetName="_blank">
                                    Licensing topic
                                </Hyperlink>
                                <Run>in the documentation for more information.</Run>
                            </Paragraph>
                        </sldg:LicensingRichTextBox.LicensingParagraph>
                    </sldg:LicensingRichTextBox>
                </Grid>
            </Grid>

        </Grid>
    </ControlTemplate>

    <!--GroupExpansion ToggleButton-->
    <Style TargetType="ToggleButton"
          x:Key="SilverlightThemeExpandCollapseToggleButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid  Background="Transparent"
                      RenderTransformOrigin="0.5,0.5">
                        <!--WPF needs to have ContentPresenter's Content defined.
                      if not, ToggleButton will be invisible -->
                        <ContentPresenter Margin="8,0,0,0"
                                    Content="{TemplateBinding Property=ContentControl.Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>












    <!--**************************
    * TEMPLATE: GroupHeaderControl
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeGroupHeaderControlTemplate"
                    TargetType="sldg:GroupHeaderControl">
        <Grid Background="#FFFFFFFF">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                </VisualStateGroup>

                <VisualStateGroup x:Name="GroupNavigationSearchBoxVisibilityStates">
                    <VisualState x:Name="GroupNavigationSearchBoxHidden" />

                    <VisualState x:Name="GroupNavigationSearchBoxVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GroupNavigationSearchBox"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="GroupNavigationSearchBox"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.250" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="GroupNavigationButtonsVisibilityStates">
                    <VisualState x:Name="GroupNavigationButtonsHidden" />

                    <VisualState x:Name="GroupNavigationButtonsVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="navButtonsBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="navButtonsBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.250" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="GroupExpansionButtonVisibilityStates">
                    <VisualState x:Name="GroupExpansionButtonVisible" />
                    <VisualState x:Name="GroupExpansionButtonHidden">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GroupExpansionButton"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="CurrentStates">
                    <VisualState x:Name="NotCurrent" />

                    <VisualState x:Name="Current">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="currentBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.6"
                                      Duration="00:00:00" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="ExpansionStates">
                    <VisualState x:Name="Expanded" />

                    <VisualState x:Name="Collapsed">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="pathRotateTransform"
                                      Storyboard.TargetProperty="Angle"
                                      To="0"
                                      Duration="00:00:00" />
                            <ColorAnimation Storyboard.TargetName="trianglePath"
                                     Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                     To="#FFB8C6D8"
                                     Duration="00:00:00" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

            </VisualStateManager.VisualStateGroups>

            <Border x:Name="rootBorder"
                 Margin="0,2,0,0"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Background="{TemplateBinding Background}"
                 CornerRadius="5" />
            <Border x:Name="currentBorder"
                 Background="{StaticResource SilverlightThemeCurrentGroupBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 Opacity="0"
                 CornerRadius="5"
                 Margin="0,2,0,0" />
            <Border Margin="0,2,0,0"
                 Padding="{TemplateBinding Padding}">

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Border x:Name="mainBorder"
                       BorderBrush="Transparent"
                       Background="Transparent"
                       BorderThickness="1"
                       Padding="0,0,0,2">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <ToggleButton x:Name="GroupExpansionButton"
                                   Margin="0,0,8,0"
                                   Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ToggleGroupExpansionCommand}"
                                   Style="{StaticResource SilverlightThemeExpandCollapseToggleButton}">
                                <ToggleButton.Content>
                                    <Path x:Name="trianglePath"
                                 Stretch="Fill"
                                 Data="M 5,4.46875 C5,4.46875 0,0 0,0 0,0 0,9 0,9 0,9 5,4.46875 5,4.46875 z"
                                 Stroke="#FFB8C6D8"
                                 Fill="Transparent"
                                 RenderTransformOrigin="0.5,0.5"
                                 Height="8"
                                 Width="6">
                                        <Path.RenderTransform>
                                            <RotateTransform x:Name="pathRotateTransform"
                                                  Angle="90" />
                                        </Path.RenderTransform>
                                    </Path>
                                </ToggleButton.Content>
                            </ToggleButton>

                            <ContentControl x:Name="GroupTitlePresenter"
                                     Grid.Column="1"
                                     MinHeight="21"
                                     IsTabStop="False"
                                     Content="{Binding}"
                                     ContentTemplate="{TemplateBinding GroupValueTemplate}"
                                     Foreground="{TemplateBinding Foreground}"
                                     VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />

                            <!--Performance Optimization. 
                           This border with hardcoded width prevent re-measuring when the content is displayed-->
                            <Border Width="200"
                             Grid.Column="2">
                                <sldg:GroupNavigationSearchBox x:Name="GroupNavigationSearchBox"
                                                       Margin="5,0,0,0"
                                                       Opacity="0"
                                                       IsTabStop="False"
                                                       Visibility="Collapsed"/>
                            </Border>

                            <!--Performance Optimization. 
                           This border with hardcoded width prevent re-measuring when the content is displayed-->
                            <Border Width="90"
                             Grid.Column="4">
                                <Border x:Name="navButtonsBorder"
                                Background="Transparent"
                                HorizontalAlignment="Right"
                                Visibility="Collapsed"
                                Opacity="0"
                                BorderThickness="1">
                                    <StackPanel Orientation="Horizontal">
                                        <Button x:Name="PreviousButton"
                                      Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PreviousGroupCommand}"
                                      Style="{StaticResource SilverlightThemeUpNavigationButtonStyle}">
                                            <Path Margin="3,1"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       Height="10"
                                       Width="26"
                                       Stretch="Fill"
                                       Opacity="1"
                                       Data="M 15,0 C15,0 0,12 0,12 0,12 30,12 30,12 30,12 15,0 15,0 z"
                                       UseLayoutRounding="False">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="2"
                                                         ShadowDepth="1"
                                                         Color="White" />
                                                </Path.Effect>
                                                <Path.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1"
                                                            StartPoint="0.5,0">
                                                        <GradientStop Color="#FF9EADC1"
                                                        Offset="1" />
                                                        <GradientStop Color="#FFC6CFDA" />
                                                    </LinearGradientBrush>
                                                </Path.Fill>
                                            </Path>
                                        </Button>

                                        <Button x:Name="NextButton"
                                      Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=NextGroupCommand}"
                                      Style="{StaticResource SilverlightThemeDownNavigationButtonStyle}">
                                            <Path Margin="3,1"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       Height="10"
                                       Width="26"
                                       Stretch="Fill"
                                       Opacity="1"
                                       Data="M 15,12 C15,12 30,0 30,0 30,0 0,0 0,0 0,0 15,12 15,12 z"
                                       UseLayoutRounding="False">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="2"
                                                         ShadowDepth="1"
                                                         Color="White" />
                                                </Path.Effect>
                                                <Path.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1"
                                                            StartPoint="0.5,0">
                                                        <GradientStop Color="#FF9EADC1"
                                                        Offset="1" />
                                                        <GradientStop Color="#FFC6CFDA" />
                                                    </LinearGradientBrush>
                                                </Path.Fill>
                                            </Path>
                                        </Button>
                                    </StackPanel>
                                </Border>
                            </Border>
                        </Grid>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>

    <!--********************************
    * TEMPLATE: GroupNavigationSearchBox
    ******************************* -->
    <ControlTemplate x:Key="SilverlightThemeGroupNavigationSearchBoxTemplate"
                    TargetType="sldg:GroupNavigationSearchBox">

        <Grid>
            <Grid.Resources>
                <Style x:Key="silverlightTextBoxStyle"
                   TargetType="ctrl:WatermarkTextBox">
                    <Setter Property="Foreground"
                       Value="Black" />

                    <Setter Property="Padding"
                       Value="0" />

                    <Setter Property="Template"
                       Value="{StaticResource SilverlightThemeGroupNavigationSearchBoxWaterMarkTemplate}" />
                </Style>

                <Style x:Key="silverlightGroupNavFindButtonStyle"
                   TargetType="Button">
                    <Setter Property="Foreground"
                       Value="#6B6A6B" />

                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Button">
                                <Grid x:Name="grid">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:00.200" />

                                                <VisualTransition From="MouseOver"
                                                      To="Pressed" />
                                            </VisualStateGroup.Transitions>

                                            <VisualState x:Name="Normal" />

                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="00:00:00.000"
                                                        To="1"
                                                        Storyboard.TargetProperty="(UIElement.Opacity)"
                                                        Storyboard.TargetName="Over" />
                                                </Storyboard>
                                            </VisualState>

                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="00:00:00.000"
                                                        To="1"
                                                        Storyboard.TargetProperty="(UIElement.Opacity)"
                                                        Storyboard.TargetName="Pressed1" />
                                                </Storyboard>
                                            </VisualState>

                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="00:00:00.000"
                                                        To="0.5"
                                                        Storyboard.TargetProperty="(UIElement.Opacity)"
                                                        Storyboard.TargetName="grid" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>

                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused" >
                                                <Storyboard>
                                                    <DoubleAnimation Duration="00:00:00.000"
                                                        To="1"
                                                        Storyboard.TargetProperty="(UIElement.Opacity)"
                                                        Storyboard.TargetName="Over" />
                                                </Storyboard>
                                            </VisualState>

                                            <VisualState x:Name="Unfocused" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>

                                    <Border x:Name="Background"
                                   BorderThickness="1"
                                   BorderBrush="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBorderBrush}"
                                   Background="{StaticResource SilverlightThemeGroupNavigationButtonDefaultBackgroundBrush}" />

                                    <Border x:Name="Over"
                                   Opacity="0"
                                   BorderThickness="1">
                                        <Border.Background>
                                            <LinearGradientBrush StartPoint="0.5,0"
                                                      EndPoint="0.5,1">
                                                <GradientStop Color="#FFfbfcfd"
                                                  Offset="0" />

                                                <GradientStop Color="#FFeef4f9"
                                                  Offset="0.36" />

                                                <GradientStop Color="#FFa4c7e5"
                                                  Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>

                                    <Border x:Name="Pressed1"
                                   Opacity="0"
                                   BorderThickness="1"
                                   Background="{StaticResource SilverlightThemeGroupNavigationButtonPressedBackgroundBrush}" />

                                    <ContentPresenter x:Name="contentPresenter"
                                             ContentTemplate="{TemplateBinding ContentTemplate}"
                                             Content="{TemplateBinding Content}"
                                             HorizontalAlignment="Center"
                                             VerticalAlignment="Center"
                                             Margin="3,0" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Grid.Resources>

            <Border x:Name="rootBorder"
                 Background="Transparent">

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <ctrl:WatermarkTextBox x:Name="SearchTextBox"
                                      Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource SilverlightThemeEmptyStringToNullConverter}, Path=Value, Mode=TwoWay}"
                                      WatermarkContent="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=WatermarkContent, Mode=OneWay}"
                                      WatermarkContentTemplate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=WatermarkContentTemplate, Mode=OneWay}"
                                      AutoSelectBehavior="OnFocus"
                                      Style="{StaticResource silverlightTextBoxStyle}" />

                    <Button x:Name="SearchButton"
                       Grid.Column="1"
                       Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=FindGroupCommand}"
                       Style="{StaticResource silverlightGroupNavFindButtonStyle}">
                        <Path x:Name="icon"
                        Data="F1 M10.7607,10.3599 C9.3807001,8.9799004 9.3816996,6.7419 10.7607,5.3618999 C12.1407,3.9828999 14.3787,3.9828999 15.7587,5.3618999 C17.137699,6.7409 17.1387,8.9808998 15.7587,10.3599 C14.3797,11.7399 12.1397,11.7389 10.7607,10.3599 M18.1047,12.7059 C20.780701,10.0299 20.780701,5.6918998 18.1047,3.0158999 C15.4287,0.33989999 11.0907,0.33989999 8.4146996,3.0158999 C6.2117,5.2189002 5.8267002,8.5479002 7.2516999,11.1509 L3.468797,14.960448 C3.0357971,15.393449 3.2577972,16.314447 3.9607971,17.018448 C4.6647973,17.721449 5.5857973,17.942448 6.017797,17.510448 L9.7577,13.7429 C12.3887,15.3109 15.8407,14.9699 18.1047,12.7059"
                        Height="14.821"
                        Stretch="Fill"
                        Width="14.808"
                        Margin="1,0">
                            <Path.Effect>
                                <DropShadowEffect BlurRadius="2"
                                          ShadowDepth="1"
                                          Color="White" />
                            </Path.Effect>
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                                    <GradientStop Color="#FF9EADC1"
                                         Offset="1" />
                                    <GradientStop Color="#FFC6CFDA" />
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                    </Button>
                </Grid>
            </Border>
        </Grid>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: DataRow
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeDataRowTemplate"
                    TargetType="sldg:DataRow">
        <Grid x:Name="rootGrid">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />

                    <VisualState x:Name="Alternate">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="alternateBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.00" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="AlternateMouseOver">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="mouseOverBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.00" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="mouseOverBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="MouseOverSelected">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="selectedBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.00" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Selected">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="selectedBorder"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00" />
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="MouseOver"
                                    To="Normal">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="mouseOverBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         To="0"
                                         Duration="00:00:00.15" />
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition From="MouseOver"
                                    To="Alternate">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="mouseOverBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         To="0"
                                         Duration="00:00:00.15" />

                                <DoubleAnimation Storyboard.TargetName="alternateBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1"
                                         Duration="00:00:00.00" />
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition From="AlternateMouseOver"
                                    To="Alternate">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="mouseOverBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.15" />

                                <DoubleAnimation Storyboard.TargetName="alternateBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1"
                                         Duration="00:00:00.00" />
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition From="Normal"
                                    To="Alternate">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="alternateBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1"
                                         Duration="00:00:00.00" />
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition From="Alternate"
                                    To="Normal">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="alternateBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.00" />
                            </Storyboard>
                        </VisualTransition>

                    </VisualStateGroup.Transitions>
                </VisualStateGroup>

                <VisualStateGroup x:Name="EditingStates">
                    <VisualState x:Name="NotBeingEdited" />

                    <VisualState x:Name="BeingEdited">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="editionGrid"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.0"
                                                Value="Visible"/>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimation Storyboard.TargetName="editionGrid"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.500">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase Power="3"
                                      EasingMode="EaseOut" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>

                            <DoubleAnimation Storyboard.TargetName="editionGlyphTranslateTransform"
                                      Storyboard.TargetProperty="X"
                                      To="0"
                                      Duration="00:00:00.500">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase Power="3"
                                      EasingMode="EaseOut" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Committing">
                        <Storyboard >

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="committingIndicator"
                                                    Storyboard.TargetProperty="CommitPending">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.1">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>
                                            True
                                        </s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="committingIndicator"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.0"
                                                Value="Visible"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>

                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="BeingEdited"
                                    To="NotBeingEdited">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="editionGrid"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.500">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3"
                                         EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>

                                <DoubleAnimation Storyboard.TargetName="editionGlyphTranslateTransform"
                                         Storyboard.TargetProperty="X"
                                         Duration="00:00:00.500">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3"
                                         EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition From="BeingEdited"
                                    To="Committing">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="editionGrid"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.500">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3"
                                         EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>

                                <DoubleAnimation Storyboard.TargetName="editionGlyphTranslateTransform"
                                         Storyboard.TargetProperty="X"
                                         Duration="00:00:00.500">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3"
                                         EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                </VisualStateGroup>

                <VisualStateGroup x:Name="ValidationStates">
                    <VisualState x:Name="ValidData" />

                    <VisualState x:Name="InvalidData">
                        <Storyboard>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="rowInvalidBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.0"
                                                Value="Visible"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="CurrentStates">
                    <VisualState x:Name="Current" />
                    <VisualState x:Name="NotCurrent" />
                </VisualStateGroup>


                <VisualStateGroup x:Name="InitializationStates">
                    <VisualState x:Name="Initialized" />
                    <VisualState x:Name="NotInitialized" >
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="CellsHost"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0"
                                      Duration="00:00:00.0" />
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="NotInitialized"
                                    To="Initialized">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="CellsHost"
                                         Storyboard.TargetProperty="Opacity"
                                         To="1"
                                         Duration="00:00:00.15" />
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid.ColumnDefinitions>
                <!--This row is reserved to be used as a RowSelector-->
                <ColumnDefinition Width="20" />

                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!-- The border responsible for the visual outline of the row (gridlines and background)
              spans the GroupLevelIndicatorPane and ElementsHost Panel. Those 2 elements are not children of
              the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
            <Border x:Name="rootBorder"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}" />

            <Border x:Name="alternateBorder"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 Background="{TemplateBinding AlternatingBackground}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}"
                 Opacity="0" />

            <Border x:Name="mouseOverBorder"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 Background="#D5E9F1"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}"
                 Padding="{TemplateBinding Padding}"
                 Opacity="0" />

            <Border x:Name="selectedBorder"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 Opacity="0"
                 BorderThickness="0"
                 BorderBrush="{StaticResource SilverlightThemeHighlightBorderBrush}"
                 Background="#BADDE9" />

            <Border x:Name="rowSelectorBorder"
                 Grid.Column="0"
                 Width="20"
                 Background="#33DADADA"
                 BorderThickness="0,0,0,0"
                 BorderBrush="LightGray"
                 ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ValidationErrorToolTip}">
                <Grid>
                    <Border x:Name="rowInvalidBorder"
                       Background="{StaticResource SilverlightThemeInvalidItemGlyphBackgroundBrush}"
                       BorderBrush="{StaticResource SilverlightThemeInvalidItemGlyphBorderBrush}"
                       BorderThickness="1"
                       Visibility="Collapsed">
                        <Border Opacity="0.35">
                            <Border.Background>
                                <LinearGradientBrush StartPoint="-0.015,0.1"
                                             EndPoint="8.618,6.282"
                                             SpreadMethod="Repeat"
                                             MappingMode="Absolute">
                                    <GradientStop Offset="0"
                                         Color="Transparent" />
                                    <GradientStop Color="Transparent"
                                         Offset="0.5" />
                                    <GradientStop Offset="0.5"
                                         Color="White" />
                                    <GradientStop Offset="1"
                                         Color="White" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                    </Border>

                    <Grid x:Name="editionGrid"
                     Width="12"
                     Opacity="0"
                     Visibility="Collapsed"
                     VerticalAlignment="Center"
                     HorizontalAlignment="Left">
                        <Path Margin="0.375,1.8800890445709229,0,0"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        Height="17.636512517929077"
                        Width="11.625"
                        Stretch="Fill"
                        Opacity="1"
                        Data="M 9.16748046875,12.301788330078125 C9.16748046875,12.301788330078125 4.78607177734375,16.6826171875 4.78607177734375,16.6826171875 4.78607177734375,16.6826171875 8.900390625,17.7138671875 8.900390625,17.7138671875 8.900390625,17.7138671875 10.1845703125,16.361328125 10.1845703125,16.361328125 10.1845703125,16.361328125 9.16748046875,12.301788330078125 9.16748046875,12.301788330078125 zM 0.375,13.882190704345703 C0.375,13.882190704345703 0.375,10.365528106689453 0.375,10.365528106689453 0.375,10.365528106689453 3.98052978515625,13.9716796875 3.98052978515625,13.9716796875 3.98052978515625,13.9716796875 6.465819835662842,11.4873046875 6.465819835662842,11.4873046875 6.465819835662842,11.4873046875 0.375,5.396149158477783 0.375,5.396149158477783 0.375,5.396149158477783 0.375,1.8800890445709229 0.375,1.8800890445709229 0.375,1.8800890445709229 9.990234375,11.493194580078125 9.990234375,11.493194580078125 9.990234375,11.493194580078125 12,19.5166015625 12,19.5166015625 12,19.5166015625 3.98541259765625,17.505859375 3.98541259765625,17.505859375 3.98541259765625,17.505859375 0.375,13.882190704345703 0.375,13.882190704345703 z">
                            <Path.Fill>
                                <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                                    <GradientStop Color="#FF7595B6"
                                         Offset="0" />
                                    <GradientStop Color="#FF9EB6CE"
                                         Offset="1" />
                                </LinearGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Grid.RenderTransform>
                            <TranslateTransform x:Name="editionGlyphTranslateTransform"
                                         X="-12" />
                        </Grid.RenderTransform>
                    </Grid>
                </Grid>
            </Border>

            <sldg:CommittingIndicator x:Name="committingIndicator"
                                   Visibility="Collapsed"
                                   Grid.Row="0" />

            <sldg:ColumnElementsHost x:Name="CellsHost"
                            Grid.Column="1"
                            Margin="{TemplateBinding BorderThickness}"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"/>

        </Grid>
    </ControlTemplate>




























    <!--**************************
    * TEMPLATE: ColumnManagerRow
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeColumnManagerRowTemplate"
                    TargetType="sldg:ColumnManagerRow">

        <Border x:Name="rootBorder"
              Background="{TemplateBinding Background}"
              Padding="{TemplateBinding Padding}">

            <Grid x:Name="rootGrid">
                <!-- The border responsible for the visual outline of the row (gridlines and background)
                       spans the GroupLevelIndicatorPane and ElementsHost Panel. Those 2 elements are not children of
                       the Border because we don't want the border to be displayed in the GroupLevelIndicatorPane. -->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Border x:Name="BackgroundGradient"
                       Grid.ColumnSpan="2"
                       Background="{TemplateBinding Background}" />

                    <!--this background is needed to create the semi-transparent shading-->
                    <Border Grid.ColumnSpan="2">
                        <Border.Background>
                            <LinearGradientBrush StartPoint=".7,0"
                                          EndPoint=".7,1">
                                <GradientStop Color="#FCFFFFFF"
                                      Offset="0.015" />
                                <GradientStop Color="#F7FFFFFF"
                                      Offset="0.375" />
                                <GradientStop Color="#E5FFFFFF"
                                      Offset="0.6" />
                                <GradientStop Color="#D1FFFFFF"
                                      Offset="1" />
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>

                    <sldg:ColumnElementsHost x:Name="CellsHost"
                                  Grid.Column="1"
                                  Margin="{TemplateBinding BorderThickness}"/>

                </Grid>

                <Border x:Name="BorderBrushBorder"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}" />

            </Grid>
        </Border>
    </ControlTemplate>
















    <!--**************************
    * TEMPLATE: DataCell
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeDataCellTemplate"
                    TargetType="sldg:DataCell">

        <Grid x:Name="CellVisual"
            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ValidationErrorToolTip}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Pressed" />

                    <VisualState x:Name="Dragged">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="CellVisual"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.20"
                                      Duration="00:00:00.250" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="CurrentStates">
                    <VisualState x:Name="NotCurrent" />

                    <VisualState x:Name="Current">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="currentBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000"
                                                Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>

                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="EditingStates">
                    <VisualState x:Name="NotBeingEdited" />

                    <VisualState x:Name="BeingEdited" />

                    <VisualState x:Name="Committing">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="CellContentHost"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.5"
                                      Duration="00:00:00.000" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="ValidationStates">
                    <VisualState x:Name="ValidData" />

                    <VisualState x:Name="InvalidData">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000"
                                                Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="errorGlyphGrid"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000"
                                                Value="Visible" />
                            </ObjectAnimationUsingKeyFrames>

                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationBorder"
                                                    Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000"
                                                Value="{StaticResource SilverlightThemeInvalidItemGlyphBorderBrush}" />
                            </ObjectAnimationUsingKeyFrames>

                            <DoubleAnimation Storyboard.TargetName="errorGlyphGrid"
                                      Storyboard.TargetProperty="Width"
                                      To="12"
                                      Duration="00:00:00.500">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase Power="3" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

            </VisualStateManager.VisualStateGroups>

            <Grid x:Name="DragContentHost">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Border x:Name="mainBorder"
                    Grid.ColumnSpan="2"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}" />

                <Border x:Name="currentBorder"
                    Visibility="Collapsed"
                    Grid.ColumnSpan="2"
                    BorderBrush="#6DBDD1"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}" />

                <Border x:Name="validationBorder"
                    Visibility="Collapsed"
                    Grid.ColumnSpan="2"
                    BorderBrush="Transparent"
                    BorderThickness="{TemplateBinding BorderThickness}" />

                <Border Grid.Column="0"
                    BorderThickness="{TemplateBinding BorderThickness}">
                    <ContentControl x:Name="CellContentHost"
                               Margin="{TemplateBinding Padding}"
                               IsTabStop="False"
                               HorizontalAlignment="Stretch"
                               VerticalAlignment="Stretch"
                               HorizontalContentAlignment="Stretch"
                               VerticalContentAlignment="Stretch" />
                </Border>

                <Grid x:Name="errorGlyphGrid"
                  Visibility="Collapsed"
                  Grid.Column="1"
                  Width="0">
                    <Border x:Name="redBackground"
                       Background="{StaticResource SilverlightThemeInvalidItemGlyphBackgroundBrush}"
                       BorderBrush="{StaticResource SilverlightThemeInvalidItemGlyphBorderBrush}"
                       BorderThickness="1" />
                    <Border x:Name="patternLine"
                       Opacity="0.35"
                       Margin="1">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="-0.015,0.1"
                                          EndPoint="8.618,6.282"
                                          SpreadMethod="Repeat"
                                          MappingMode="Absolute">
                                <GradientStop Offset="0"
                                      Color="Transparent" />
                                <GradientStop Color="Transparent"
                                      Offset="0.5" />
                                <GradientStop Offset="0.5"
                                      Color="White" />
                                <GradientStop Offset="1"
                                      Color="White" />
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Grid>
            </Grid>
        </Grid>

    </ControlTemplate>























    <!--**************************
    * STYLE: SilverlightThemeFixedToggleButtonStyle
    ************************** -->
    <Style x:Key="SilverlightThemeFixedToggleButtonStyle"
          TargetType="CheckBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid HorizontalAlignment="Left"
                     VerticalAlignment="Center">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="UncheckedPath"
                                              Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                              Duration="00:00:00.200"
                                              To="#FF679ECB" />
                                        <ColorAnimation Storyboard.TargetName="CheckedPath"
                                              Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                              Duration="00:00:00.200"
                                              To="#FF679ECB" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                              To="#7F4C5773"
                                              Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                              Storyboard.TargetName="CheckedPath" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="Checked"
                                             To="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="UncheckedPath"
                                                  Storyboard.TargetProperty="Opacity"
                                                  Duration="00:00:00.000"
                                                  To="1" />
                                            <DoubleAnimation Storyboard.TargetName="CheckedPath"
                                                  Storyboard.TargetProperty="Opacity"
                                                  Duration="00:00:00.000"
                                                  To="0" />
                                            <DoubleAnimation Storyboard.TargetName="UncheckedPathRotateTransform"
                                                  Storyboard.TargetProperty="Angle"
                                                  Duration="00:00:00.200"
                                                  To="20" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Unchecked"
                                             To="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="UncheckedPathRotateTransform"
                                                  Storyboard.TargetProperty="Angle"
                                                  Duration="00:00:00.200"
                                                  To="-6" />
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="UncheckedPathRotateTransform"
                                               Storyboard.TargetProperty="Angle"
                                               Duration="00:00:00.200"
                                               To="-6" />
                                        <DoubleAnimation Storyboard.TargetName="UncheckedPath"
                                               Storyboard.TargetProperty="Opacity"
                                               BeginTime="00:00:00.000"
                                               Duration="00:00:00.000"
                                               To="0" />
                                        <DoubleAnimation Storyboard.TargetName="CheckedPath"
                                               Storyboard.TargetProperty="Opacity"
                                               BeginTime="00:00:00.000"
                                               Duration="00:00:00.000"
                                               To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Rectangle Fill="Transparent" />
                        <Path x:Name="UncheckedPath"
                        Fill="#7F4C5773"
                        Data="M8.2853384,8.7960901 C8.8139019,8.4446192 9.3881254,8.1752014 9.607914,7.5031738 C9.9174986,6.5587769 9.1607695,5.7814789 8.0160856,5.9202118 C7.8057442,5.3063202 7.6814899,4.6666722 7.5234871,4.006042 C7.3745461,3.383316 7.0880909,2.6928861 7.0687752,2.0918729 C7.0448637,1.3447571 7.632206,-0.022888005 6.6519656,-0.15388501 C6.1654387,-0.219055 5.4912906,-0.026947021 5.0222344,0.10374498 C4.0627928,0.37164307 3.2583189,0.72534204 2.4447813,1.208221 C2.140872,1.3885651 1.5232267,1.6977081 1.4974852,2.0918729 C1.4523649,2.775696 2.6482725,3.3225708 2.9752836,3.7116089 C3.3591185,4.1672668 3.6414213,4.8587799 3.9608488,5.404953 C4.2980523,5.9816589 4.6023746,6.5587769 4.9464445,7.0615234 C4.6944456,7.332016 4.3916802,7.4759216 4.2639794,7.7976074 C3.6622496,9.3128204 5.8266635,9.8133392 6.9929996,9.1229095 C7.8758726,10.554199 8.2329378,12.911339 9.346693,12.734826 C9.3493643,12.739647 8.7074423,10.205667 8.2853384,8.7960901 z"
                        RenderTransformOrigin="0.771,0.962"
                        Margin="-0.125,0,0.125,0"
                        UseLayoutRounding="False">
                            <Path.RenderTransform>
                                <RotateTransform x:Name="UncheckedPathRotateTransform"
                                         Angle="20"
                                         CenterX="0"
                                         CenterY="0" />
                            </Path.RenderTransform>
                        </Path>
                        <Path x:Name="CheckedPath"
                        Fill="#FF4C5773"
                        Data="M8.2853384,8.7960901 C8.8139019,8.4446192 9.3881254,8.1752014 9.607914,7.5031738 C9.9174986,6.5587769 9.1607695,5.7814789 8.0160856,5.9202118 C7.8057442,5.3063202 7.6814899,4.6666722 7.5234871,4.006042 C7.3745461,3.383316 7.0880909,2.6928861 7.0687752,2.0918729 C7.0448637,1.3447571 7.632206,-0.022888005 6.6519656,-0.15388501 C6.1654387,-0.219055 5.4912906,-0.026947021 5.0222344,0.10374498 C4.0627928,0.37164307 3.2583189,0.72534204 2.4447813,1.208221 C2.140872,1.3885651 1.5232267,1.6977081 1.4974852,2.0918729 C1.4523649,2.775696 2.6482725,3.3225708 2.9752836,3.7116089 C3.3591185,4.1672668 3.6414213,4.8587799 3.9608488,5.404953 C4.2980523,5.9816589 4.6023746,6.5587769 4.9464445,7.0615234 C4.6944456,7.332016 4.3916802,7.4759216 4.2639794,7.7976074 C3.6622496,9.3128204 5.8266635,9.8133392 6.9929996,9.1229095 C7.8758726,10.554199 8.2329378,12.911339 9.346693,12.734826 C9.3493643,12.739647 8.7074423,10.205667 8.2853384,8.7960901 z"
                        Opacity="0"
                        RenderTransformOrigin="0.771,0.962"
                        Margin="-0.125,0,0.125,0"
                        UseLayoutRounding="False">
                            <Path.RenderTransform>
                                <RotateTransform CenterX="0"
                                         CenterY="0"
                                         Angle="-6" />
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--**************************
    * TEMPLATE: ColumnManagerCell
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeColumnManagerCellTemplate"
                    TargetType="sldg:ColumnManagerCell">

        <Grid x:Name="CellVisual"
            Background="{TemplateBinding Background}">

            <VisualStateManager.VisualStateGroups>

                <VisualStateGroup x:Name="CommonStates">

                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                      Storyboard.TargetName="MouseOverBackgroundRectangle"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color"
                                     To="#7FFFFFFF" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color"
                                     To="#CCFFFFFF" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color"
                                     To="#F2FFFFFF" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                      Storyboard.TargetName="PressedBackgroundRectangle"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[0].Color"
                                     To="#D8FFFFFF" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color"
                                     To="#C6FFFFFF" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color"
                                     To="#8CFFFFFF" />
                            <ColorAnimation Duration="0"
                                     Storyboard.TargetName="BackgroundGradient"
                                     Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color"
                                     To="#3FFFFFFF" />
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Dragged">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="CellVisual"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0.20"
                                      Duration="00:00:00.250" />
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="MouseOver"
                                    To="Normal"
                                    GeneratedDuration="00:00:00.25" />

                    </VisualStateGroup.Transitions>
                </VisualStateGroup>

                <VisualStateGroup x:Name="SortStates">
                    <VisualState x:Name="Descending">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sortGlyphRotateTransform"
                                      Storyboard.TargetProperty="Angle"
                                      To="180"
                                      Duration="00:00:00" />

                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                    Storyboard.TargetProperty="Visibility"
                                                    Storyboard.TargetName="sortGlyph">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Ascending">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sortGlyphRotateTransform"
                                      Storyboard.TargetProperty="Angle"
                                      To="0"
                                      Duration="00:00:00" />

                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                    Storyboard.TargetProperty="Visibility"
                                                    Storyboard.TargetName="sortGlyph">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="None">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="sortGlyphRotateTransform"
                                      Storyboard.TargetProperty="Angle"
                                      To="0"
                                      Duration="00:00:00" />

                            <DoubleAnimation Storyboard.TargetName="sortGlyph"
                                      Storyboard.TargetProperty="Opacity"
                                      To="0"
                                      Duration="00:00:00" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="ColumnVisibilityStates">
                    <VisualState x:Name="Scrolling" >
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedCheckBox"
                                                    Storyboard.TargetProperty="IsChecked"
                                                    Duration="00:00:00.000">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>False</s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Fixed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedCheckBox"
                                                    Storyboard.TargetProperty="IsChecked"
                                                    Duration="00:00:00.000">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>True</s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

                <VisualStateGroup x:Name="FixedColumnToggleButtonVisibilityStates">
                    <VisualState x:Name="FixedColumnToggleButtonHidden">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="fixedCheckBox"
                                      Storyboard.TargetProperty="Width"
                                      Duration="00:00:00.250">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase EasingMode="EaseOut"
                                      Power="3" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="FixedColumnToggleButtonVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedCheckBox"
                                                    Storyboard.TargetProperty="IsHitTestVisible"
                                                    Duration="00:00:00.000">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                    <DiscreteObjectKeyFrame.Value>
                                        <s:Boolean>True</s:Boolean>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>

                            <DoubleAnimation Storyboard.TargetName="fixedCheckBox"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00" />

                            <DoubleAnimation Storyboard.TargetName="fixedCheckBox"
                                      Storyboard.TargetProperty="Width"
                                      To="16"
                                      Duration="00:00:00.250">
                                <DoubleAnimation.EasingFunction>
                                    <PowerEase EasingMode="EaseOut"
                                      Power="3" />
                                </DoubleAnimation.EasingFunction>
                            </DoubleAnimation>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>

            </VisualStateManager.VisualStateGroups>

            <Grid x:Name="DragContentHost">
                <Border BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}">
                    <Grid>
                        <Grid>
                            <Border x:Name="BackgroundAnimation"
                             Opacity="0"
                             Background="#FF448DCA" />

                            <Rectangle x:Name="BackgroundRectangle"
                                Stretch="Fill"
                                Fill="{TemplateBinding Background}" />

                            <Rectangle x:Name="MouseOverBackgroundRectangle"
                                Stretch="Fill"
                                Fill="#FF448DCA"
                                Opacity="0" />

                            <Rectangle x:Name="PressedBackgroundRectangle"
                                Stretch="Fill"
                                Fill="#FF448DCA"
                                Opacity="0" />

                            <Rectangle x:Name="BackgroundGradient">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint=".7,0"
                                                EndPoint=".7,1">
                                        <GradientStop Color="#FCFFFFFF"
                                            Offset="0.015" />
                                        <GradientStop Color="#F7FFFFFF"
                                            Offset="0.375" />
                                        <GradientStop Color="#E5FFFFFF"
                                            Offset="0.6" />
                                        <GradientStop Color="#D1FFFFFF"
                                            Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>

                        <Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Margin="{TemplateBinding Padding}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <CheckBox x:Name="fixedCheckBox"
                               Grid.Column="0"
                               Opacity="0"
                               Width="0"
                               Margin="0,0,0,0"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Left"
                               Style="{StaticResource SilverlightThemeFixedToggleButtonStyle}"
                               IsTabStop="False"
                               IsHitTestVisible="False"
                               IsChecked="False"
                               Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ToggleParentColumnIsFixedCommand}" />

                            <ContentControl ContentTemplate="{TemplateBinding ContentTemplate}"
                                     Content="{TemplateBinding Content}"
                                     Foreground="{TemplateBinding Foreground}"
                                     Grid.Column="1"
                                     Margin="0,5,0,5" />

                            <ContentPresenter x:Name="sortGlyph"
                                       Grid.Column="2"
                                       Margin="5,0,0,0"
                                       Visibility="Collapsed"
                                       RenderTransformOrigin="0.5,0.5"
                                       HorizontalAlignment="Right">
                                <ContentPresenter.Content>
                                    <Canvas Width="9"
                                   Height="5"
                                   IsHitTestVisible="False"
                                   RenderTransformOrigin="0.5,0.5">
                                        <Path Opacity="1"
                                    Data="M 4.53125,0.15625 C4.53125,0.15625 9,5 9,5 9,5 0,5 0,5 0,5 4.53125,0.15625 4.53125,0.15625 z"
                                    Fill="Black" />
                                    </Canvas>
                                </ContentPresenter.Content>
                                <ContentPresenter.RenderTransform>
                                    <TransformGroup>
                                        <RotateTransform x:Name="sortGlyphRotateTransform" />
                                    </TransformGroup>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                        </Grid>

                        <Thumb x:Name="ColumnResizingThumb"
                         HorizontalAlignment="Right"
                         Cursor="SizeWE"
                         Opacity="0"
                         Width="6" />
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </ControlTemplate>












































    <!--**************************
    * TEMPLATE: LoadingIndicator
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeLoadingIndicatorTemplate"
                    TargetType="sldg:LoadingIndicator">
        <Border x:Name="loadingGlyphBackground"
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Opacity="0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="RequestStates">

                    <VisualState x:Name="NoPendingRequests" />

                    <VisualState x:Name="RequestsPending">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="loadingGlyphBackground"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.350" />
                            <DoubleAnimation Storyboard.TargetName="loadingGlyph"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.350" />
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="RequestsPending"
                                    To="NoPendingRequests">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="loadingGlyphBackground"
                                         Storyboard.TargetProperty="Opacity"
                                         BeginTime="00:00:0.5"
                                         To="0"
                                         Duration="00:00:00.350" />
                                <DoubleAnimation Storyboard.TargetName="loadingGlyph"
                                         Storyboard.TargetProperty="Opacity"
                                         BeginTime="00:00:0.5"
                                         To="0"
                                         Duration="00:00:00.350" />
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <sldg:LoadingSpinner x:Name="loadingGlyph"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              Opacity="0"
                              Value="{TemplateBinding AnimatedValue}" />
        </Border>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: LoadingSpinner
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeLoadingSpinnerTemplate"
                    TargetType="sldg:LoadingSpinner">
        <Border Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Width="40"
              Height="40">
            <Grid>
                <!-- Shadows -->
                <Border x:Name="Shadow14"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="336" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow13"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="312" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow12"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="288" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow11"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="264" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow10"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="240" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow09"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="216" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow08"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="192" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow07"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="168" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow06"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="144" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow05"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="120" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow04"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="96" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow03"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="72" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow02"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="48" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow01"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top">
                    <Border.RenderTransform>
                        <RotateTransform Angle="24" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow00"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush }"
                    Height="8"
                    VerticalAlignment="Top" />

                <!-- Highlights -->
                <Border x:Name="Highlight14"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=336}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="336" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight13"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=312}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="312" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight12"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=288}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="288" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight11"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=264}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="264" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight10"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=240}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="240" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight09"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=216}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="216" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight08"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=192}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="192" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight07"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=168}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="168" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight06"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=144}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="144" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight05"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=120}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="120" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight04"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=96}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="96" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight03"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=72}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="72" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight02"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=48}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="48" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight01"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    UseLayoutRounding="False"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=24}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="24" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Highlight00"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush }"
                    Height="8"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=0}" />
            </Grid>
        </Border>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: CommittingIndicator
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeCommittingIndicatorTemplate"
                    TargetType="sldg:CommittingIndicator">
        <Border x:Name="committingSpinnerBackground"
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Opacity="0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommitStates">

                    <VisualState x:Name="NoPendingCommit" />

                    <VisualState x:Name="CommitPending">
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetName="committingSpinnerBackground"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.350" />
                            <DoubleAnimation Storyboard.TargetName="committingSpinner"
                                      Storyboard.TargetProperty="Opacity"
                                      To="1"
                                      Duration="00:00:00.350" />
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition From="CommitPending"
                                    To="NoPendingCommit">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="committingSpinnerBackground"
                                         Storyboard.TargetProperty="Opacity"
                                         BeginTime="00:00:0.5"
                                         To="0"
                                         Duration="00:00:00.350" />
                                <DoubleAnimation Storyboard.TargetName="committingSpinner"
                                         Storyboard.TargetProperty="Opacity"
                                         BeginTime="00:00:0.5"
                                         To="0"
                                         Duration="00:00:00.350" />
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <sldg:CommittingSpinner x:Name="committingSpinner"
                                 VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 Opacity="0"
                                 Value="{TemplateBinding AnimatedValue}" />
        </Border>
    </ControlTemplate>

    <!--**************************
    * TEMPLATE: CommittingSpinner
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeCommittingSpinnerTemplate"
                    TargetType="sldg:CommittingSpinner">
        <Border Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
              Height="16"
              Width="16">
            <Grid>
                <!-- Shadows -->

                <Border x:Name="Shadow00"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Height="6"
                    VerticalAlignment="Top"
                    Opacity="0.5" />
                <Border x:Name="Shadow01"
                    HorizontalAlignment="Right"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Margin="0,2.5,1.75,7.5"
                    UseLayoutRounding="False"
                    Opacity="0.5">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="-1" />
                            <RotateTransform Angle="-120" />
                        </TransformGroup>
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow02"
                    HorizontalAlignment="Right"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Margin="0,7.375,1.625,2.625"
                    UseLayoutRounding="False"
                    Opacity="0.5">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="-1" />
                            <RotateTransform Angle="-60" />
                        </TransformGroup>
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow03"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Height="6"
                    VerticalAlignment="Bottom"
                    Opacity="0.5" />
                <Border x:Name="Shadow04"
                    HorizontalAlignment="Left"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Margin="1.875,7.375,0,2.625"
                    UseLayoutRounding="False"
                    Opacity="0.5">
                    <Border.RenderTransform>
                        <RotateTransform Angle="60" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="Shadow05"
                    HorizontalAlignment="Left"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ShadowBrush}"
                    Margin="1.75,2.5,0,7.5"
                    UseLayoutRounding="False"
                    Opacity="0.5">
                    <Border.RenderTransform>
                        <RotateTransform Angle="120" />
                    </Border.RenderTransform>
                </Border>

                <!-- Highlights -->

                <Border x:Name="_00"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Height="6"
                    VerticalAlignment="Top"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=180}" />
                <Border x:Name="_01"
                    HorizontalAlignment="Right"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Margin="0,2.5,1.75,7.5"
                    UseLayoutRounding="False"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=240}">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="-1" />
                            <RotateTransform Angle="-120" />
                        </TransformGroup>
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="_02"
                    HorizontalAlignment="Right"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Margin="0,7.375,1.625,2.625"
                    UseLayoutRounding="False"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=300}">
                    <Border.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="-1" />
                            <RotateTransform Angle="-60" />
                        </TransformGroup>
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="_03"
                    HorizontalAlignment="Center"
                    Width="4"
                    RenderTransformOrigin="0.5,2.45"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Height="6"
                    VerticalAlignment="Bottom"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=0}" />
                <Border x:Name="_04"
                    HorizontalAlignment="Left"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Margin="1.875,7.375,0,2.625"
                    UseLayoutRounding="False"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=60}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="60" />
                    </Border.RenderTransform>
                </Border>
                <Border x:Name="_05"
                    HorizontalAlignment="Left"
                    Width="4"
                    RenderTransformOrigin="0.5,0.5"
                    CornerRadius="2.4"
                    Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HighlightBrush}"
                    Margin="1.75,2.5,0,7.5"
                    UseLayoutRounding="False"
                    Opacity="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ratio, Converter={StaticResource SilverlightThemeRatioToOpacityConverter}, ConverterParameter=120}">
                    <Border.RenderTransform>
                        <RotateTransform Angle="120" />
                    </Border.RenderTransform>
                </Border>
            </Grid>
        </Border>
    </ControlTemplate>


    <!--**************************
    * STYLE: DataGridControl
    ************************** -->
    <Style x:Key="SilverlightThemeDataGridControlStyle"
          TargetType="sldg:DataGridControl">
        <Setter Property="FontFamily"
              Value="Calibri" />

        <Setter Property="BorderThickness"
              Value="0" />

        <Setter Property="FontSize"
              Value="12" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeDataGridControlTemplate}" />
    </Style>






    <!--**************************
    * STYLE: GroupHeaderControl
    ************************** -->
    <Style x:Key="SilverlightThemeGroupHeaderControlStyle"
          TargetType="sldg:GroupHeaderControl">

        <Setter Property="Background"
              Value="{StaticResource SilverlightThemeGroupBackgroundBrush}" />

        <Setter Property="Foreground"
              Value="#7691B4" />

        <Setter Property="BorderThickness"
              Value="1" />

        <Setter Property="BorderBrush"
              Value="{StaticResource SilverlightThemeBorderBrush}" />

        <Setter Property="Padding"
              Value="6,3,6,6" />

        <Setter Property="IsTabStop"
                Value="False" />

        <Setter Property="VerticalContentAlignment"
              Value="Center" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeGroupHeaderControlTemplate}" />
    </Style>

    <!--***************************
   * STYLE: GroupNavigationSearchBox
   ****************************-->

    <Style x:Key="SilverlightThemeGroupNavigationSearchBoxStyle"
          TargetType="sldg:GroupNavigationSearchBox">
        <Setter Property="WatermarkContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid VerticalAlignment="Center">
                        <TextBlock Text="{Binding}"
                             Opacity="0.7"
                             FontStyle="Italic" />
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeGroupNavigationSearchBoxTemplate}" />
    </Style>


    <!--**************************
    * STYLE: DataRow
    ************************** -->
    <Style x:Key="SilverlightThemeDataRowStyle"
          TargetType="sldg:DataRow">

        <Setter Property="Background"
              Value="#60FFFFFF" />

        <Setter Property="AlternatingBackground"
              Value="#60D1D4D8" />

        <Setter Property="ValidationErrorToolTipContentTemplate"
              Value="{StaticResource SilverlightThemeValidationErrorTemplate}" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeDataRowTemplate}" />

    </Style>







    <!--**************************
    * STYLE: ColumnManagerRow
    ************************** -->
    <Style x:Key="SilverlightThemeColumnManagerRowStyle"
          TargetType="sldg:ColumnManagerRow">

        <Setter Property="BorderBrush"
              Value="{StaticResource SilverlightThemeBorderBrush}" />

        <Setter Property="BorderThickness"
              Value="0,0,0,1" />

        <Setter Property="Background"
              Value="#FF1F3B53" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeColumnManagerRowTemplate}" />

    </Style>











    <!--**************************
    * STYLE: DataCell
    ************************** -->
    <Style x:Key="SilverlightThemeDataCellStyle"
          TargetType="sldg:DataCell">
        <!-- Set the Cell's background to Transparent to make it hit-testable
           while preserving the background drawn by the underlying Row. -->
        <Setter Property="Background"
              Value="Transparent" />

        <Setter Property="BorderBrush"
              Value="Transparent" />

        <Setter Property="Padding"
              Value="4,0,4,0" />

        <Setter Property="BorderThickness"
              Value="1" />

        <Setter Property="HorizontalContentAlignment"
              Value="Stretch" />

        <Setter Property="VerticalContentAlignment"
              Value="Center" />

        <Setter Property="ValidationErrorToolTipContentTemplate"
              Value="{StaticResource SilverlightThemeValidationErrorTemplate}" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeDataCellTemplate}" />

    </Style>











    <!--**************************
    * STYLE: ColumnManagerCell
    ************************** -->
    <Style x:Key="SilverlightThemeColumnManagerCellStyle"
          TargetType="sldg:ColumnManagerCell">
        <!-- Set the Cell's background to Transparent to make it hit-testable
           while preserving the background drawn by the underlying Row. -->
        <Setter Property="Background"
              Value="#FF1F3B53" />

        <Setter Property="BorderThickness"
              Value="1,0,0,0" />

        <Setter Property="Padding"
              Value="4,0,4,0" />

        <Setter Property="BorderBrush"
              Value="{StaticResource SilverlightThemeBorderBrush}" />

        <Setter Property="Foreground"
              Value="Black" />

        <Setter Property="HorizontalContentAlignment"
              Value="Left" />

        <Setter Property="VerticalContentAlignment"
              Value="Center" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeColumnManagerCellTemplate}" />

    </Style>



















    <!--***************************
    * STYLE: DataGridComboBox
    ****************************-->
    <Style x:Key="SilverlightThemeDataGridComboBoxStyle"
          TargetType="sldg:DataGridComboBox">
        <Setter Property="HorizontalAlignment"
              Value="Stretch" />

        <Setter Property="VerticalAlignment"
              Value="Stretch" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sldg:DataGridComboBox">
                    <ComboBox Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
                         DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
                         Foreground="{TemplateBinding Foreground}"
                         HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                         ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
                         ItemsSource="{TemplateBinding ItemsSource}"
                         ItemTemplate="{TemplateBinding ItemTemplate}"
                         Margin="{TemplateBinding Margin}"
                         MaxDropDownHeight="{TemplateBinding MaxDropDownHeight}"
                         Padding="{TemplateBinding Padding}"
                         SelectedIndex="{Binding SelectedIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                         SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                         SelectedValuePath="{TemplateBinding SelectedValuePath}"
                         SelectedValue="{Binding SelectedValue, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                         VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--***************************
   * STYLE: DataGridTextBox
   ****************************-->
    <Style x:Key="SilverlightThemeDataGridTextBoxStyle"
          TargetType="sldg:DataGridTextBox">
        <Setter Property="AutoSelectBehavior"
              Value="OnFocus" />

        <Setter Property="Padding"
              Value="0" />

        <Setter Property="HorizontalAlignment"
              Value="Stretch" />

        <Setter Property="VerticalAlignment"
              Value="Stretch" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeAutoSelectTextBoxEditorTemplate}" />
    </Style>

    <!--***************************
   * STYLE: DataGridNumericTextBox
   ****************************-->
    <Style x:Key="SilverlightThemeDataGridNumericTextBoxStyle"
          TargetType="sldg:DataGridNumericTextBox">
        <Setter Property="AutoSelectBehavior"
              Value="OnFocus" />

        <Setter Property="Padding"
              Value="0" />

        <Setter Property="HorizontalAlignment"
              Value="Stretch" />

        <Setter Property="VerticalAlignment"
              Value="Stretch" />

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeNumericTextBoxEditorTemplate}" />
    </Style>

    <!--***************************
   * STYLE: DataGridCheckBox
   ****************************-->
    <Style x:Key="SilverlightThemeDataGridCheckBoxStyle"
          TargetType="sldg:DataGridCheckBox">
        <Setter Property="HorizontalAlignment"
              Value="Stretch" />

        <Setter Property="VerticalAlignment"
              Value="Stretch" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="sldg:DataGridCheckBox">
                    <CheckBox Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
                         ClickMode="{TemplateBinding ClickMode}"
                         Command="{TemplateBinding Command}"
                         CommandParameter="{TemplateBinding CommandParameter}"
                         Content="{TemplateBinding Content}"
                         ContentTemplate="{TemplateBinding ContentTemplate}"
                         Foreground="{TemplateBinding Foreground}"
                         HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                         IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                         IsThreeState="{TemplateBinding IsThreeState}"
                         Margin="{TemplateBinding Margin}"
                         Padding="{TemplateBinding Padding}"
                         VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--**************************
    * STYLE: LoadingIndicator
    ************************** -->
    <Style x:Key="SilverlightThemeLoadingIndicatorStyle"
          TargetType="sldg:LoadingIndicator">
        <Setter Property="FadeOutAnimationDuration"
              Value="850" />
        <Setter Property="AnimationDuration"
              Value="1000" />
        <Setter Property="Background"
              Value="Transparent" />
        <Setter Property="VerticalContentAlignment"
              Value="Bottom" />
        <Setter Property="HorizontalContentAlignment"
              Value="Right" />
        <Setter Property="IsHitTestVisible"
              Value="False" />
        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeLoadingIndicatorTemplate}" />
    </Style>

    <!--**************************
    * STYLE: LoadingSpinner
    ************************** -->
    <Style x:Key="SilverlightThemeLoadingSpinnerStyle"
          TargetType="sldg:LoadingSpinner">
        <Setter Property="Margin"
              Value="10" />
        <Setter Property="HighlightBrush"
              Value="{StaticResource SilverlightThemeLoadingSpinnerHighlightBackgroundBrush}" />
        <Setter Property="ShadowBrush"
              Value="{StaticResource SilverlightThemeLoadingSpinnerShadowBackgroundBrush}" />
        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeLoadingSpinnerTemplate}" />
    </Style>

    <!--**************************
    * STYLE: CommittingIndicator
    ************************** -->
    <Style x:Key="SilverlightThemeCommittingIndicatorStyle"
          TargetType="sldg:CommittingIndicator">
        <Setter Property="FadeOutAnimationDuration"
              Value="850" />
        <Setter Property="AnimationDuration"
              Value="1000" />
        <Setter Property="IsHitTestVisible"
              Value="False" />
        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeCommittingIndicatorTemplate}" />
    </Style>

    <!--**************************
    * STYLE: CommittingSpinner
    ************************** -->
    <Style x:Key="SilverlightThemeCommittingSpinnerStyle"
          TargetType="sldg:CommittingSpinner">
        <Setter Property="HighlightBrush"
              Value="{StaticResource SilverlightThemeCommittingSpinnerHighlightBackgroundBrush}" />
        <Setter Property="ShadowBrush"
              Value="{StaticResource SilverlightThemeCommittingSpinnerShadowBackgroundBrush}" />
        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeCommittingSpinnerTemplate}" />
    </Style>

    <!--**************************
    * STYLE: NotificationControl
    ************************** -->
    <Style x:Key="SilverlightThemeNotificationControlStyle"
          TargetType="sldg:NotificationControl">
        <Setter Property="Template"
              Value="{StaticResource notificationControlTemplate}" />
    </Style>


    <!--*************************
    * STYLE : Button
    * This style is used in SharePoint
    *************************** -->
    <Style x:Key="ButtonStyle"
               TargetType="Button">
        <Setter Property="Foreground"
                                                  Value="#FF333333" />
        <Setter Property="BorderThickness"
                                                  Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                                                   To="1"
                                                                                   Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundOverlay" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#7FFFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#CCFFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#F2FFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                                                   To="1"
                                                                                   Storyboard.TargetProperty="Opacity"
                                                                                   Storyboard.TargetName="BackgroundOverlay2" />
                                        <DoubleAnimation Duration="0"
                                                                                   To="1"
                                                                                   Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                   Storyboard.TargetName="Highlight" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#E5FFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#BCFFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#6BFFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                        <ColorAnimation Duration="0"
                                                                                  To="#F2FFFFFF"
                                                                                  Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                                                  Storyboard.TargetName="BackgroundGradient" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                                                 Storyboard.TargetProperty="Visibility"
                                                                                                 Storyboard.TargetName="FocusVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Background"
                                                                 Fill="{TemplateBinding Background}"
                                                                 RadiusY="3"
                                                                 RadiusX="3"
                                                                 Stroke="{TemplateBinding BorderBrush}"
                                                                 StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="BackgroundOverlay"
                                                                 Fill="#FF448DCA"
                                                                 Opacity="0"
                                                                 RadiusY="3"
                                                                 RadiusX="3"
                                                                 Stroke="#00000000"
                                                                 StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="BackgroundOverlay2"
                                                                 Fill="#FF448DCA"
                                                                 Opacity="0"
                                                                 RadiusY="3"
                                                                 RadiusX="3"
                                                                 Stroke="#00000000"
                                                                 StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="BackgroundGradient"
                                                                 Margin="{TemplateBinding BorderThickness}"
                                                                 RadiusY="2"
                                                                 RadiusX="2"
                                                                 Stroke="#FFFFFFFF"
                                                                 StrokeThickness="1">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint=".7,1"
                                                                                 StartPoint=".7,0">
                                    <GradientStop Color="#FFFFFFFF"
                                                                             Offset="0" />
                                    <GradientStop Color="#F9FFFFFF"
                                                                             Offset="0.375" />
                                    <GradientStop Color="#E5FFFFFF"
                                                                             Offset="0.625" />
                                    <GradientStop Color="#C6FFFFFF"
                                                                             Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="BackgroundOverlay3"
                                                                 Fill="#FF448DCA"
                                                                 Opacity="0"
                                                                 RadiusY="3"
                                                                 RadiusX="3"
                                                                 Stroke="#00000000"
                                                                 StrokeThickness="{TemplateBinding BorderThickness}" />
                        <Rectangle x:Name="BackgroundGradient2"
                                                                 Margin="{TemplateBinding BorderThickness}"
                                                                 Opacity="0"
                                                                 RadiusY="2"
                                                                 RadiusX="2"
                                                                 Stroke="#FFFFFFFF"
                                                                 StrokeThickness="1">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint=".7,1"
                                                                                 StartPoint=".7,0">
                                    <GradientStop Color="#FFFFFFFF"
                                                                             Offset="0" />
                                    <GradientStop Color="#F9FFFFFF"
                                                                             Offset="0.375" />
                                    <GradientStop Color="#E5FFFFFF"
                                                                             Offset="0.625" />
                                    <GradientStop Color="#C6FFFFFF"
                                                                             Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="Highlight"
                                                                 IsHitTestVisible="false"
                                                                 Margin="{TemplateBinding BorderThickness}"
                                                                 Opacity="0"
                                                                 RadiusY="2"
                                                                 RadiusX="2"
                                                                 Stroke="#6DBDD1"
                                                                 StrokeThickness="1" />
                        <ContentPresenter x:Name="contentPresenter"
                                                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                        Content="{TemplateBinding Content}"
                                                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                        Margin="{TemplateBinding Padding}"
                                                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Rectangle x:Name="FocusVisualElement"
                                                                 IsHitTestVisible="false"
                                                                 Margin="1"
                                                                 RadiusY="3.5"
                                                                 RadiusX="3.5"
                                                                 Stroke="#6DBDD1"
                                                                 StrokeThickness="1"
                                                                 Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--**************************
    * TEMPLATE: ColumnBackgroundControl
    ************************** -->
    <ControlTemplate x:Key="SilverlightThemeColumnBackgroundControlTemplate"
                    TargetType="sldg:ColumnBackgroundControl">

        <Grid x:Name="ColumnVisual">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="ColumnVisibilityStates">
                    <VisualState x:Name="Scrolling">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0"
                                                Value="Collapsed"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                    Storyboard.TargetProperty="Opacity">
                                <DiscreteObjectKeyFrame KeyTime="0"
                                                Value="0"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>

                    <VisualState x:Name="Fixed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                    Storyboard.TargetProperty="Visibility">
                                <DiscreteObjectKeyFrame KeyTime="0"
                                                Value="Visible"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                    Storyboard.TargetProperty="Opacity">
                                <DiscreteObjectKeyFrame KeyTime="0"
                                                Value="1"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>

                    <VisualStateGroup.Transitions>
                        <VisualTransition To="Scrolling">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                       Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0"
                                                   Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>

                                <DoubleAnimation Storyboard.TargetName="fixedBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.500"
                                         To="0">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </VisualTransition>

                        <VisualTransition To="Fixed">
                            <Storyboard>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="fixedBorder"
                                                       Storyboard.TargetProperty="Visibility">
                                    <DiscreteObjectKeyFrame KeyTime="0"
                                                   Value="Visible"/>
                                </ObjectAnimationUsingKeyFrames>

                                <DoubleAnimation Storyboard.TargetName="fixedBorder"
                                         Storyboard.TargetProperty="Opacity"
                                         Duration="00:00:00.500"
                                         To="1">
                                    <DoubleAnimation.EasingFunction>
                                        <PowerEase Power="3" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                            </Storyboard>
                        </VisualTransition>
                    </VisualStateGroup.Transitions>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid x:Name="DragContentHost">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Border x:Name="fixedBorder"
                    Visibility="Collapsed"
                    Grid.ColumnSpan="2"
                    BorderBrush="{StaticResource SilverlightThemeFixedCellBackgroundBrush}"
                    Background="{StaticResource SilverlightThemeFixedCellBackgroundBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Opacity="0" />
            </Grid>
        </Grid>

    </ControlTemplate>

    <!--**************************
    * STYLE: ColumnBackgroundControl
    ************************** -->
    <Style x:Key="SilverlightThemeColumnBackgroundControlStyle"
          TargetType="sldg:ColumnBackgroundControl">

        <Setter Property="Template"
              Value="{StaticResource SilverlightThemeColumnBackgroundControlTemplate}" />
    </Style>

</ResourceDictionary>
